import request from '@/utils/request'

// 查询排班信息
export function getWorkforceList(query) {
    return request({
        url: '/med-admin-medical-management/scheduling/getWorkforceList',
        method: 'get',
        params: query
    })
}

// 修改排班状态
export function updateWorkforceStatus(scheduleId) {
    return request({
        url: '/med-admin-medical-management/scheduling/updateWorkforceStatus/' + scheduleId,
        method: 'put',
    })
}

// 删除排班
export function deleteWorkforce(scheduleId) {
    return request({
        url: '/med-admin-medical-management/scheduling/deleteWorkforce/' + scheduleId,
        method: 'delete',
    })
}

// 修改排班信息
export function updateWorkforce(data) {
    return request({
        url: '/med-admin-medical-management/scheduling/updateWorkforce',
        method: 'post',
        data: data
    })
}

// 根据科室获取医生列表
export function getDoctorListByDepartment(departmentId) {
    return request({
        url: '/med-admin-medical-management/scheduling/getDoctorListByDepartment/' + departmentId,
        method: 'get',
    })
}

// 新增排班
export function addSchedule(data) {
    return request({
        url: '/med-admin-medical-management/scheduling/addWorkforce',
        method: 'post',
        data: data
    })
}

// 智能排班开关
export function toggleSchedulingStatus() {
    return request({
        url: '/med-admin-medical-management/task/enableScheduling',
        method: 'put',
    })
}

// 获取智能排班状态
export function getScheduleStatus() {
    return request({
        url: '/med-admin-medical-management/task/getScheduleStatus',
        method: 'get',
    })
}
